import Component from './index.vue';
import { outputEventList } from './../constants'

const meta = {
  componentName: 'Condition',
  title: '条件组件',
  type: 'condition',
  w: 4,
  h: 1,
  imgName:'view3',
  props: [
    {
      name: 'componentId',
      rules: {
        required: false,
      },
      desc: '组件编号',
      defaultValue: '',
    },
    {
      name: 'size',
      propType: {
        type: 'string',
        required: false,
      },
      desc: '组件尺寸',
      defaultValue: '',
    },
    {
      name: 'title',
      rules: {
        type: 'string',
        required: true
      },
      desc: '组件标题',
      defaultValue: '请输入标题'
    },
    {
      name: 'desc',
      rules: {
        required: false,
      },
      desc: '组件描述',
      defaultValue: '请输入组件描述'
    },
    {
      name: 'imageId',
      rules: {
        required: false,
      },
      desc: '组件缩略图',
      defaultValue: '1'
    },
    {
      name: 'outputEvents',
      rules: {
        type: 'array',
        required: false,
      },
      desc: '可输出事件',
      defaultValue:  []
    },
  ],
  configure: {
    basicProps: {
      title: '组件基本属性',
      override: [
        {
          name: 'componentId',
          setter: 'StringSetter',
        },
        {
          name: 'size',
          setter: 'StringSetter',
        },
        {
          name: 'title',
          setter: 'InputSetter',
        },
        {
          name: 'desc',
          setter: {
            componentName:'InputSetter',
            props:{
              maxlength: 500,
              type:'textarea'
            }
          },
        },
       {
        name:'imageId',
        setter: {
          componentName: 'UploadSetter',
        }
       }
      ]
    },

    commonProps: {
      title: '组件通用属性',
      override: [
        {
          name: 'outputEvents',
          setter: {
            componentName: 'ListSetter',
            props: {
              options: ['48小时','7天','30天','90天']
            },
          },
        },
      ]}
  }
}

export default {
  componentName: meta.componentName,
  componentMeta: meta,
  component: Component
}
